﻿package com
{
	import com.IsoObject;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	/**
	 * ...
	 * @author sixxis69
	 */
	public class Avatar extends IsoObject
	{	
		private var xoffset:Number;
		private var yoffset:Number;
		private var gfx:DisplayObject;
		
		public function Avatar() 
		{
			super(size);
			
			handleFace(fl);
		}
		
		public function handleFace(classRef:Class):void
		{
			if (this.numChildren > 0)
			{
				removeChildAt(0);
			}
			
			var bmd:BitmapData = new classRef(20, 49) as BitmapData;
			var gfx:Bitmap = new Bitmap(bmd);
			gfx.x = -10;
			gfx.y = -45;
			addChild(gfx);
		}
		
		public function backLeft():void
		{
			handleFace(bl);
		}
		
		public function backRight():void
		{
			handleFace(br);
		}
		
		public function frontLeft():void
		{
			handleFace(fl);
		}
		
		public function frontRight():void
		{
			handleFace(fr);
		}
		
	}

}